1. Field of the Invention
The present invention relates to a semiconductor memory device having data protection means. More specifically, the present invention relates to a technique for protecting already programmed data.
2. Description of the Related Art
It has been often the case that a nonvolatile semiconductor memory device, such as a flash memory, is used for its advantage of being capable of updating storage contents as a memory device of data or a program code, in place of a conventional read-only memory (ROM).
In nonvolatile semiconductor memory devices capable of updating storage contents, data destruction might occur due to programming or erasure caused by an operation error or a signal error such as a noise (hereinafter described as “programming error” or “erasure error”). Some nonvolatile semiconductor memory devices thus have a data protection function for preventing the programming error and erasure error.
As a first method for data protection in the prior art, there is a method having a mechanism in which a control terminal for data protection is prepared, and programming and erasure are permitted when an input voltage at an “H” (high) level has been applied to the control terminal, whereas programming and erasure are inhibited when an input voltage at an “L” (low) level has been applied to the control terminal. When updating storage contents, the input level of the control terminal for data protection is set to “H” to erase data or program update data. In performing data-reading alone, the input level of the control terminal is set to “L” so as to prevent programming error or erasure error.
As a second method for data protection in the prior art, there is a method having a mechanism in which a storage region in a flash memory or the like is divided into a plurality of blocks, a storage element (hereinafter, referred to as “block protection bit”) for recording data protection information corresponding to each of the blocks is prepared, and when “0” has been programmed into the block protection bit, programming or erasure of data into or from the corresponding block is permitted, whereas when “1” has been programmed into the block protection bit, programming or erasure of data into or from the corresponding block is inhibited. When updating data, “0” is programmed into the block protection bit in a block to be updated, to erase the block or program update data into the block. After the data update, “1” is programmed into the block protection bit to prevent the data destruction due to programming error or erasure error.
Further, as a third method for data protection in the prior art, there is a method having a mechanism in which a storage element (hereinafter referred to as “data protection bit”) for recording data protection information corresponding to each storage address is prepared, and when “0” has been programmed into the data protection bit, programming of data into the storage address is permitted, whereas when “1” has been programmed into the data protection bit, programming of data into the storage address is prohibited. For example, there are methods for data protection disclosed in JP-A 01-103752 (1989) and JP-A 63-68948 (1988).
In the case of using the above first and second methods in the prior art, there is a problem in that, since data protection is released during data update, already programmed data cannot be protected from being destroyed due to programming error while data protection is released.
In the above first method of the prior art, since programming of data is permitted with the input level of the control terminal set to “H” during data update, already programmed data might be rewritten with another data.
In the above second method of the prior art, a block protection bit, corresponding to a block not to be updated, is set to “1” to protect already programmed data from being rewritten with another data due to programming error. However, since a block protection bit, corresponding to a block to be updated, is set to “0” to permit programming of data, already programmed data might be rewritten with another data due to programming error.
In the above third method of the prior art, already programmed data can be protected by programming “1” into a protection bit corresponding to the already programmed address. However, there is a problem with this method in that each storage address needs a separate data protection bit from each other, thereby to increase a storage element area. In the case of a memory device with a word length of eight bits, for example, a one-bit data protection storage element needs to be added to the eight-bit data storage elements, which increases the storage element area by 12.5%.